package cn.gov.pbc.dream.common;

import lombok.AllArgsConstructor;
import lombok.Getter;

public class BankFinancingProductInfoConst {


    @AllArgsConstructor
    @Getter
    public enum Category {
        FINANCIAL_PRODUCT(1, "理财产品"),
        CAPITAL_TRUST(2, "资金信托");

        private int code;
        private String value;

        public static Category codeOf(int code) {
            for (Category category : values()) {
                if (category.getCode() == code) {
                    return category;
                }
            }
            return null;
        }
    }

    @AllArgsConstructor
    @Getter
    public enum CollectionMethod {
        PUBLIC(1, "公募"),
        PRIVATE(2, "私募");
        private int code;
        private String value;

        public static CollectionMethod codeOf(int code) {
            for (CollectionMethod collectionMethod : values()) {
                if (collectionMethod.getCode() == code) {
                    return collectionMethod;
                }
            }
            return null;
        }
    }

    @AllArgsConstructor
    @Getter
    public enum ManageMethod {
        SET(1, "集合管理"),
        SOLO(2, "单独管理");
        private int code;
        private String value;

        public static ManageMethod codeOf(int code) {
            for (ManageMethod manageMethod : values()) {
                if (manageMethod.getCode() == code) {
                    return manageMethod;
                }
            }
            return null;
        }
    }

    @Getter
    @AllArgsConstructor
    public enum RunMethod {
        OPEN_END_NET(2, "开放式净值型"),
        OPEN_END_NON_NET(3, "开放式非净值型"),
        CLOSE_END_NET(4, "封闭式净值型"),
        CLOSE_END_NON_NET(5, "封闭式非净值型");
        private int code;
        private String value;

        public static RunMethod codeOf(int code) {
            for (RunMethod runMethod : values()) {
                if (runMethod.getCode() == code) {
                    return runMethod;
                }
            }
            return null;
        }
    }

    @Getter
    @AllArgsConstructor
    public enum ProductType {
        BOND_MONEY_MARKET(1, "债券及货货市场类"),
        CREDITOR(2, "债权类"),
        CAPITAL_MARKET(3, "资本市场"),
        STOCK(4, "股权类"),
        HYBRID_OLD(5, "混合类"),
        ANOTHER(6, "另类"),
        FIX_INCOME(7, "固定收益类"),
        EQUITY(8, "权益类"),
        DERIVATIVE(9, "商品及金融衍生品类"),
        HYBRID(10, "混合类"),
        ON_BALANCE_SHEET(11, "表内");
        private int code;
        private String value;

        public static ProductType codeOf(int code) {
            for (ProductType productType : values()) {
                if (productType.getCode() == code) {
                    return productType;
                }
            }
            return null;
        }
    }

    @AllArgsConstructor
    @Getter
    public enum BusinessModel {
        ON_BALANCE_SHEET_DEPOSIT(1, "表内存款"),
        ON_BALANCE_SHEET_NON_DEPOSIT(2, "表内非存款负债"),
        OFF_BALANCE_SHEET(3, "表外");
        private int code;
        private String value;

        public static BusinessModel codeOf(int code) {
            for (BusinessModel businessModel : values()) {
                if (businessModel.getCode() == code) {
                    return businessModel;
                }
            }
            return null;
        }
    }

    @AllArgsConstructor
    @Getter
    public enum IncomeProtection {
        YES(1, "是"),
        NO(2, "否");
        private int code;
        private String value;

        public static IncomeProtection codeOf(int code) {
            for (IncomeProtection incomeProtection : values()) {
                if (incomeProtection.getCode() == code) {
                    return incomeProtection;
                }
            }
            return null;
        }
    }

    @AllArgsConstructor
    @Getter
    public enum PrincipalProtection {
        YES(1, "是"),
        NO(2, "否");
        private int code;
        private String value;

        public static PrincipalProtection codeOf(int code) {
            for (PrincipalProtection principalProtection : values()) {
                if (principalProtection.getCode() == code) {
                    return principalProtection;
                }
            }
            return null;
        }
    }

    @AllArgsConstructor
    @Getter
    public enum EarlyTerminationRight {
        HAS_RIGHT(1, "有"),
        NO_RIGHT(2, "无");
        private int code;
        private String value;

        public static EarlyTerminationRight codeOf(int code) {
            for (EarlyTerminationRight earlyTerminationRight : values()) {
                if (earlyTerminationRight.getCode() == code) {
                    return earlyTerminationRight;
                }
            }
            return null;
        }
    }

    @AllArgsConstructor
    @Getter
    public enum Foreclosures {
        HAS_RIGHT(1, "有"),
        NO_RIGHT(2, "无");;
        private int code;
        private String value;

        public static Foreclosures codeOf(int code) {
            for (Foreclosures foreclosures : values()) {
                if (foreclosures.getCode() == code) {
                    return foreclosures;
                }
            }
            return null;
        }
    }

    @AllArgsConstructor
    @Getter
    public enum IncreaseCredit {
        YES(1, "是"),
        NO(2, "否");
        private int code;
        private String value;

        public static IncreaseCredit codeOf(int code) {
            for (IncreaseCredit increaseCredit : values()) {
                if (increaseCredit.getCode() == code) {
                    return increaseCredit;
                }
            }
            return null;
        }
    }

    @AllArgsConstructor
    @Getter
    public enum FiduciaryDuty {
        ACTIVELY(1, "主动管理业务"),
        PASSIVE(2, "被动管理业务");
        private int code;
        private String value;

        public static FiduciaryDuty codeOf(int code) {
            for (FiduciaryDuty fiduciaryDuty : values()) {
                if (fiduciaryDuty.getCode() == code) {
                    return fiduciaryDuty;
                }
            }
            return null;
        }
    }

    @AllArgsConstructor
    @Getter
    public enum CooperationModal {
        INDEPENDENT(11, "独立运行"),
        BANK_AND_TRUST(12, "银信合作"),
        BANK_AND_INSURANCE(13, "银保合作"),
        BANK_AND_FUND(14, "银基合作"),
        BANK_AND_SECURITY(15, "银证合作"),
        HYBRID(16, "混合类"),
        OTHER(17, "其他"),
        NOT_APPLICABLE(18, "不适用");
        private int code;
        private String value;

        public static CooperationModal codeOf(int code) {
            for (CooperationModal cooperationModal : values()) {
                if (cooperationModal.getCode() == code) {
                    return cooperationModal;
                }
            }
            return null;
        }
    }

    @AllArgsConstructor
    @Getter
    public enum Grading {
        YES(1, "是"),
        NO(2, "否");
        private int code;
        private String value;

        public static Grading codeOf(int code) {
            for (Grading grading : values()) {
                if (grading.getCode() == code) {
                    return grading;
                }
            }
            return null;
        }
    }

    @AllArgsConstructor
    @Getter
    public enum IncomeRightTransfer {
        YES(1, "是"),
        NO(2, "否");
        private int code;
        private String value;

        public static IncomeRightTransfer codeOf(int code) {
            for (IncomeRightTransfer incomeRightTransfer : values()) {
                if (incomeRightTransfer.getCode() == code) {
                    return incomeRightTransfer;
                }
            }
            return null;
        }
    }

    @AllArgsConstructor
    @Getter
    public enum SponsorSign {
        COMMERCIAL_BANK(1, "商业银行发行"),
        FINANCIAL_SUBSIDIARY(2, "理财子公司发行");
        private int code;
        private String value;

        public static SponsorSign codeOf(int code) {
            for (SponsorSign sponsorSign : values()) {
                if (sponsorSign.getCode() == code) {
                    return sponsorSign;
                }
            }
            return null;
        }
    }

    @AllArgsConstructor
    @Getter
    public enum CurrencyType {
        RAISED(1, "募集资金币种"),
        CASHING_PRINCIPAL(2, "兑付本金币种"),
        CASHING_PROFIT(3, "兑付收益币种");
        private int code;
        private String value;

        public static CurrencyType codeOf(int code) {
            for (CurrencyType currencyType : values()) {
                if (currencyType.getCode() == code) {
                    return currencyType;
                }
            }
            return null;
        }
    }

    @AllArgsConstructor
    @Getter
    public enum CustomerType {
        COMPANY(1, "单位"),
        PERSON(2, "个人"),
        COMPANY_AND_PERSON(3, "单位及个人");
        private int code;
        private String value;

        public static CustomerType codeOf(int code) {
            for (CustomerType customerType : values()) {
                if (customerType.getCode() == code) {
                    return customerType;
                }
            }
            return null;
        }
    }

    @AllArgsConstructor
    @Getter
    public enum IncreaseCreditType {
        GOVERNMENT(1, "广义政府"),
        NON_FINANCIAL_COMPANY(2, "非金融性公司"),
        FINANCIAL_COMPANY(3, "金融性公司"),
        HOUSEHOLD_SECTOR(4, "住户部门"),
        FOREIGN_SECTOR(5, "国外部门");
        private int code;
        private String value;

        public static IncreaseCreditType codeOf(int code) {
            for (IncreaseCreditType increaseCreditType : values()) {
                if (increaseCreditType.getCode() == code) {
                    return increaseCreditType;
                }
            }
            return null;
        }
    }

    @AllArgsConstructor
    @Getter
    public enum IncreaseMethod {
        INTERNAL(1, "内部增级"),
        EXTERNAL(2, "外部增级");
        private int code;
        private String value;

        public static IncreaseMethod codeOf(int code) {
            for (IncreaseMethod increaseMethod : values()) {
                if (increaseMethod.getCode() == code) {
                    return increaseMethod;
                }
            }
            return null;
        }
    }
}
